Importing Wells from Databases
Use these options to import well data from a database using Open Database Connectivity (ODBC).
In order to use this tool, ODBC (32 bits) must be installed in your computer. The database editor (MS Access, Aries, etc.) needs not be running or even installed.
Before using this feature in PetroVR, you need to create the connection to the database in ODBC. You can do this from the ODBC interface: click on New and select the database type, then navigate to the database file and enter a name for the connection.
In the first window of the PetroVR Import Wizard enter the general settings for the import process:
- Data source: Select the connection you created from the list of existing connections.
- User name: User name to access the database. Not needed for MS Access databases (.mdb).
- Password: Password to access the database. Not needed for MS Access databases (.mdb).
- Project: Select the project from among the projects defined in the database (only for Aries databases).
- Scenario: Select the scenario from among the scenarios defined in the database (only for Aries databases).
- Mapping file: Select the .xml file that maps the database data to PetroVR objects.
The next window contains settings related to how the data will be imported:
- New PetroVR Project / Current PetroVR Project: Create a new project to import the well data or merge with an existing project. Note that existing well with identical names will be overwritten.
- Oil Wells / Gas Wells / Main Fluid specified in Database: Import all wells as oil / gas or use the Main Fluid property defined in the mapping file. Choosing oil or gas here will override the latter.
- Create drilling jobs: Create a drilling job for each well imported.
- Import Costs: The costs that can be imported are Drilling Fixed Cost and Completion Fixed Cost.
- Import Interests: The interests that can be imported are the Working Interest and Net Interest.
The Mapping File
The mapping file is an .xml file that links the source data in the database and the target PetroVR objects.
The general format of the .xml file is:
<mappings>
<object name = "Well" table = "...">
<property name = "..." value = "..."/>
…
</object>
<object name = "Well Performance" table = "...">
<property name = "..." value = "..."/>
…
</object>
</mappings>
The two <object> tagged elements refer to wells and declines respectively. The various <property> elements describe the way PetroVR will read Aries data.
In the <object name = "Well"> tag select the source table in the database using the table parameter. To refer to data from a table other than the one selected, use the format [table].[column].[foreign key]. In databases other than Aries, you also need to specify the primary key parameter thus: <primaryKey = "Primary Key">.
Then enter a <property> line for each well input to be read from the database, and use the value parameter to select a column in the table. These are the well properties currently supported:
- Well Name
- Reservoir
- Main Fluid
- Drilling Start Date
- Drilling End Date
- Drilling Fixed Cost
- Drilling Rig
- Completion Start Date
- Completion End Date
- Completion Time
- Completion Fixed Cost
- Completion Rig
- Net Interest
- Working Interest
- Well OpEx
Well Name and Reservoir are mandatory. Main Fluid is mandatory if you select Main Fluid specified in Database in the Wizard. All other properties assume the default PetroVR value if left unspecified.
Main Fluid accepts Oil, Gas or Inj (= water injection).
Properties related to time and costs require a unit parameter, since the data from the database are read as plain numbers, e.g.:
<property name = "Well OpEx" value = "USER3" unit = "$MM/day"/>
In most property lines you can also enter a different value by using a constant parameter instead of value, e.g.:
<property name = "Completion Time" constant = "15" unit = "day"/>
If both a constant and a value parameter are entered, the former takes precedence.
The value parameter accepts simple expressions combining column names and constant values with basic operators (+ - * /), e.g.:
<property name = "Drilling Fixed Cost" value = "USER3 + USER4" unit = "$M"/>
If a column name is a numerical value, to avoid confusion with a constant value enclose it between square brackets:
<property name = "Drilling Time" value = "Time + [2] + 5" unit = "$M"/>
where "2" is the name of a column and "5" is a constant.
It is possible to define the duration of the drilling using either Drilling Time or Drilling End Date - Drilling Start Date. If both are entered Drilling Time takes precedence. The same happens with Completion Time vs. Completion end Date - Completion Start Date.
In the <object name = "Well Performance"> tag enter the database table from which performance values will be retrieved, and three <property> lines:
<property name = "Production Date" value = "..."/>,
<property name = "Oil Production" value = "..." unit = "..."/>
<property name = "Gas Production" value = "..." unit = "..."/>
If the well property Main Fluid is "Inj" (water injection), these lines are ignored and the well takes the default performance for water injectors.